package com.sali.controller;

import com.sali.pojo.CourseCategory;
import com.sali.service.ICourseCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @description:
 * @author: sali
 * @date: 2024/8/26 下午12:01.
 * @version: 1.0
 */
@Controller
public class CourseCategoryController {

    @Autowired
    ICourseCategoryService courseCategoryService;

    @GetMapping("/tree")
    public String tree2() {
        return "tree";
    }

    /**
     * @return
     * @Description 查询分类接口信息
     * @Date 9:26 上午 2022/3/8
     * @Param
     **/
    @GetMapping("/api/category/tree")
    @ResponseBody
    public List<CourseCategory> tree() {
        return courseCategoryService.findCategoriesTree();
    }

}
